def matches(left, right):
    left_brackets = "([{"
    right_brackets = ")]}"
    return left_brackets.index(left) == right_brackets.index(right)


def par_checker(symbol_string):
    """

    :param symbol_string:
    :return:
    """
    if len(symbol_string) % 2:
        return False
    stack = []
    balanced = True
    index = 0
    while index < len(symbol_string) and balanced:
        symbol = symbol_string[index]
        if symbol in '([{':
            stack.append(symbol)
        else:
            if not stack:
                balanced = False
            else:
                top = stack.pop()
                if not matches(top, symbol):
                    balanced = False
        index += 1

    if balanced and not stack:
        return True
    else:
        return False


if __name__ == '__main__':
    print(par_checker('){}'))
